<?php
namespace app\index\controller;

class Article extends Base
{
    public function index()
    {
        $id=input('catid');
        db('article')->where('cateid',$id)->setInc('click');
        $article = db('article')->alias('a')->join('ym_cate c','c.id=a.cateid','LEFT')
            ->field('a.id,a.title,a.pic,a.time,a.desc,a.click,a.keywords,a.conter,c.catename')->where('a.id', $id)->find();
        $this->assign('article', $article);
        $this->assign('lis',db('article')->order('click desc')->select());
        return $this->fetch('article');
    }
}
